<template>
	<view>
		<view class="flex_box">
			<view class="f_it">
				<view class="f_tit">钱包总余额</view>
				<view class="f_num">{{sendmoney.usemoney}}</view>
			</view>
			<view class="f_it">
				<view class="f_tit">昨日申请中</view>
				<view class="f_num">{{sendmoney.ynum.money}}</view>
			</view>
			<view class="f_it">
				<view class="f_tit">今日申请中</view>
				<view class="f_num">{{sendmoney.tnum.money}}</view>
			</view>
		</view>
		<view class="flex_box">
			<view class="f_it">
				<view class="f_tit">累积放款</view>
				<view class="f_num">{{sendmoney.anum.sendmoney}}</view>
			</view>
			<view class="f_it">
				<view class="f_tit">昨日已放款</view>
				<view class="f_num">{{sendmoney.yanum.sendnum}}</view>
			</view>
			<view class="f_it">
				<view class="f_tit">今日已放款</view>
				<view class="f_num">{{sendmoney.tanum.sendnum}}</view>
			</view>
		</view>
		<view class="f_list">
			<view class="f_item" v-for="item in finList">
				<view class="f_logo" v-if="item.avatar">
					<image :src="item.avatar"></image>
				</view>
				<view class="f_info clamp">
					<view class="f_tit">
						<text class="clamp">({{item.mid}})({{item.send_type}}){{item.nickname}}</text>
					</view>
					<view class="f_time">申请时间：{{item.createtime}}</view>
					<view class="f_time" v-if="item.sendtime">处理时间：{{item.sendtime}}</view>
				</view>
				<view class="f_num">{{item.money_send}}</view>
				<view class="f_status f_reject" v-if="item.status=='驳回'">{{item.status}}</view>
				<view class="f_status f_pass" v-else-if="item.status=='已发放'">{{item.status}}</view>
				<view class="f_status" v-else>{{item.status}}</view>
			</view>
		</view>
		<view class="empty_loading">
			<image v-if="isloading" src="/static/business/loading.gif" mode=""></image>
			<view v-if="ismore">到底了~</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				finList: [],
				page: 0,
				isloading: false,
				ismore: false,
				sendmoney: [],
			};
		},
		onLoad(){
			this.getFinList();
			this.getSendmoney();
		},
		onReachBottom(){
			this.getFinList();
		},
		methods: {
			getFinList(){
				this.page++;
				this.isloading = true;
				this.ismore = false;
				this.$axios('Moneylog/moneylist','POST','commission',{
					page: this.page
				}).then(res=>{
					this.isloading = false;
					if(res.data.code == 200){
						this.finList = [...this.finList, ...res.data.data.list];
						this.ismore = res.data.data.list.length <= 0;
					}
				})
			},
			getSendmoney(){
				this.$axios('statistics/sendmoney','POST','member').then(res=>{
					if(res.data.code==200){
						this.sendmoney = res.data.data
					}
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.flex_box{
		background: #E3C7FF;
	}
	.f_it{
		width: 33%;
		text-align: center;
		margin-bottom: 30rpx;
		.f_tit{
			font-size: 26rpx;
			color: #666666;
			margin-bottom: 16rpx;
		}
		.f_num{
			font-size: 30rpx;
			color: #333333;
			font-weight: 600;
		}
	}
.f_list{
	padding: 0 0 40rpx;
	.f_item{
		display: flex;
		justify-content: space-between;
		align-items: center;
		border-bottom: 1rpx solid #ece7e7;
		padding: 30rpx 20rpx;
		box-shadow: 2rpx 2rpx 12rpx 0rpx rgba(200,200,200,.5);
		.f_logo{
			width: 80rpx;
			height: 80rpx;
			margin-right: 10rpx;
			border-radius: 8rpx;
			overflow: hidden;
			image{
				width: 100%;
				height: 100%;
			}
		}
		.f_info{
			flex: 1;
		}
		.f_time{
			color: #666;
			font-size: 24rpx;
			margin-top: 8rpx;
		}
		.f_num{
			color: #d82626;
			width: 20%;
			text-align: center;
			white-space: nowrap;
		}
		.f_status{
			color: $bg-color;
			font-size: 26rpx;
			width: 88rpx;
			text-align: right;
		}
		.f_pass{
			color: green;
			
		}
		.f_reject{
			color: red;
		}
	}
}
</style>
